package com.orangelife.service.base.common;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;

@JsonSerialize(include = Inclusion.NON_EMPTY)
public class GridHeader {
	private String label;
	private String sqlFieldName;

	private Align align;
	private String signId;

	@Override
	public String toString() {
		return "sqlFieldName:" + sqlFieldName + ", label:" + label;
	}

	private boolean gridVisible = true;

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public GridHeader(String label, String sqlFieldName) {
		this.label = label;
		this.sqlFieldName = sqlFieldName;
	}

	public GridHeader(String label, String sqlFieldName, String signId) {
		this.label = label;
		this.sqlFieldName = sqlFieldName;
		this.signId = signId;
	}

	public GridHeader(String label, String sqlFieldName, String signId,
			boolean gridVisible) {
		this.label = label;
		this.sqlFieldName = sqlFieldName;
		this.signId = signId;
		this.gridVisible = gridVisible;
	}

	/**
	 * 
	 * @param label
	 * @param sqlFieldName
	 * @param signId
	 * @param gridVisible
	 */
	// public GridHeader(String label, String sqlFieldName, boolean gridVisible)
	// {
	// this.label = label;
	// this.sqlFieldName = sqlFieldName;
	// this.gridVisible = gridVisible;
	// }

	// public GridHeader(String label, String sqlFieldName, boolean isJsonOut) {
	// this.label = label;
	// this.sqlFieldName = sqlFieldName;
	// this.jsonOut = isJsonOut();
	// }

	@JsonIgnore
	public String getSqlFieldName() {
		return sqlFieldName;
	}

	public void setSqlFieldName(String sqlFieldName) {
		this.sqlFieldName = sqlFieldName;
	}

	@JsonSerialize(include = Inclusion.NON_NULL)
	public Align getAlign() {
		return align;
	}

	public void setAlign(Align align) {
		this.align = align;
	}

	/**
	 * 前台grid是否显示
	 * 
	 * @return
	 */
	@JsonSerialize(include = Inclusion.NON_NULL)
	public boolean isGridVisible() {
		return gridVisible;
	}

	/**
	 * 
	 * @param gridVisible
	 */
	public void setGridVisible(boolean gridVisible) {
		this.gridVisible = gridVisible;
	}

	public String getSignId() {
		return signId;
	}

	public void setSignId(String signId) {
		this.signId = signId;
	}

}
